package com.cuiweiyou.happypaint.base;

import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.os.StrictMode;

import com.cuiweiyou.happypaint.util.SPUtil;
import com.cuiweiyou.happypaint.util.ToastUtil;
import com.cuiweiyou.happypaint.util.UncaughtExceptionUtil;

public class BaseApplication extends Application {
    private static Context context;

    @Override
    public void onCreate() {
        super.onCreate();
        context = getApplicationContext();

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            StrictMode.setVmPolicy(builder.build());
        }

        UncaughtExceptionUtil.getInstance().init(context);
        SPUtil.getInstance().init(context);
        ToastUtil.init(context);
    }

    public static Context getContext() {
        return context;
    }

}
